package com.bwie.controller;
import com.bwie.pojo.Type;
import com.bwie.service.TypeService;
import com.bwie.service.impl.TypeServiceImpl;
import com.bwie.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;

/**
* 分类表(t_type)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/shop/index/")
@Api(tags = "类型模块")
public class TypeController {
/**
* 服务对象
*/
    @Autowired
    private TypeService typeService;


        @ApiOperation("上传图片")
    @PostMapping("uploadFile")
    public R uploadFile(@RequestPart("file")MultipartFile file){
            return typeService.uploadFile(file);
        }

        @ApiOperation("新增类型")
        @PostMapping("saveType")
    public R saveType(@RequestBody Type type){
            return typeService.saveType(type);
        }

        @ApiOperation("查询分级列表")
        @PostMapping("selectTypeList")
        public R selectTypeList(@RequestBody Type type){
            return typeService.selectTypeList(type);
        }


}
